package com.ldy.frame;

/**
 * Created by MacBook Pro on 2017/12/5.
 */
import javax.swing.*;

import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.NativeLibrary;


public class VideoPanel {

    private static View frame;
    static JFrame jf;
    public static void main(String[] args) {
        NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),"vlc");
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                try{
                    /*
                    frame =new View();
                    frame.setTitle("MediaPlayer");
                    frame.setVisible(true);
                    frame.setSize(500,500);
                    frame.getMediaPlayer().playMedia("C:\\Users\\MacBook Pro\\Desktop\\娱乐\\1.mp4");
                    */
                    jf =new JFrame();
                    frame =new View();
                    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    jf.setTitle("MediaPlayer");
                    jf.setVisible(true);
                    jf.setSize(500,500);
                    jf.add(frame);
                    frame.getMediaPlayer().playMedia("C:\\Users\\MacBook Pro\\Desktop\\娱乐\\1.mp4");
                }catch (Exception e)
                {
                    e.printStackTrace();
                }
            }
        });
    }

}
